package dao;

import java.util.List;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;

public interface CommentDao {

	//查询重复的评论（弃用）
	@Select(value="select count(*) from comment where essay_id=#{essayId} and user_id=#{userId}")
	public int selectrepeat(@Param("essayId") Integer essayId,@Param("userId") Integer userId);
	
	//删除评论
	@Delete(value="delete from comment where essay_id=#{essayId}")
	public int DeleteAllEssay(Integer essayId);
	
	//根据用户id查询文章ID 
	@Select(value="SELECT DISTINCT essay_id FROM comment WHERE user_id=#{userId}  ORDER BY comment_date DESC ")
	public List<Integer> selectEssayIdByUserId(@Param("userId")Integer userId);
	
}
